package com.cherrypt.api.model.bo;

import com.cherrypt.api.model.util.BeanUtils;
import com.cherrypt.api.model.dataobject.Notice;
import com.cherrypt.api.model.dto.NoticeDto;

import java.util.ArrayList;
import java.util.List;

public class NoticeBo {
    public static List<NoticeDto> getNoticeDtoList(List<Notice> noticeList) {
        List<NoticeDto> noticeDtoList = new ArrayList<>();
        noticeList.forEach(notice -> {
            NoticeDto noticeDTO = new NoticeDto();
            BeanUtils.copyFieldToBean(notice, noticeDTO);
            noticeDtoList.add(noticeDTO);
        });
        return noticeDtoList;
    }
}
